package chapter08;

public class Day4 {
    public static void main(String[] args) {
        int num = 1;
        int sum = 0;
        while (num <= 1000) {
            if (num % 7 == 0) {
                System.out.print(num + " ");
                sum++;//每输出一个数字，进行加一
                if (sum %10== 7) {//控制每一行输出的个数是7个
                    System.out.println("");
                }
            }
            num++;
        }
        System.out.println("\n1-1000能被7整除的数有"+sum);
    }
}
